package com.webcamtracker.image.color.rgb;

import com.webcamtracker.image.Color;
import com.webcamtracker.image.GrayScaleColor;

import java.awt.image.BufferedImage;

/**
 * Created by IntelliJ IDEA.
 * User: user
 * Date: Sep 25, 2007
 * Time: 10:45:11 PM
 * To change this template use File | Settings | File Templates.
 */
public class GrayScaleColorSampler implements ColorSampler {
    public Color getColorAt(BufferedImage image, int x, int y) {
        int rgb = image.getRGB(x, y);
        return new GrayScaleColor(rgb);
    }

    public Color getColorFrom(RGBColor color) {
        return new GrayScaleColor(color);
    }
}
